<template>
	<!--POP画册/POP下单/道具下单 图片列表-->
	<view class="com-box" @click.stop="toDet(obj.id,obj.title,obj.type)">
		<image class="com-box-img" :src="obj.img"></image>
		<image class="sel-img" :src="$mAssetsPath.icon_replace" v-if="objstatu.replace_statu" @click.stop="replace_img(obj.id)"></image>
		<view class="com-box-r" v-if="type==='pop'">
			<view class="com-box-r-name">{{obj.title}}</view>
			<view class="com-box-r-name">金额：{{obj.price}}</view>
		</view>
		<view class="com-box-r" v-else-if="type==='prop'">
			<view class="com-box-r-name">任务：{{obj.title}}</view>
			<view class="com-box-r-name">历史成交：{{obj.money}}元</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "com-top",
		components: {},
		props: {
			type:{
				type:String,
				default:'pop'
			},
			obj: {
				type: Object,
				default () {
					return {
						id:1,
						head_img: '/static/data-img/img.jpg',
						title: '张三',
						statu:1,
						stick_statu:1 //1-置顶
					}
				}
			},
			objstatu: {
				type: Object,
				default () {
					return {
						replace_statu:1,
						stick_del_statu:1 //1-置顶
					}
				}
			}
		},
		data() {
			return {
			}
		},
		methods:{
			replace_img(id){
				this.$emit('replace_img',id)
			},
			checked(id,e){
				this.$emit('checked',id,e)
			},
			deleted(e){
				this.$emit('deleted',e)
			},
			toDet(id,title,type){
				this.$emit('toDet',id,title,type)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.com-box {
		display: flex;
		flex-direction: column;
		position: relative;
		
		.sel-img{
			position: absolute;
			right: 30rpx;
			top: 30rpx;
			width: 60rpx;
			height: 60rpx;
		}
		.com-box-img{
			width: 100%;
			height: 388rpx;
			border-radius: 10rpx;
			margin-bottom: 20rpx;
			
		}
		.com-box-r{
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			.com-box-r-name{
				width: 100%;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
				font-size: 32rpx;
				font-weight: 400;
				color: $font-color-3;
				height: 50rpx;
				line-height: 50rpx;
			}
		}
		
 	}
</style>
